let rightCount
let f = document.getElementById("movie-list");
function delayedLoad() {
    rightCount = Math.floor(f.clientWidth/1020);
}

var delayInMilliseconds = 100;
setTimeout(delayedLoad, delayInMilliseconds);
let leftCount = 0;

// 增加left值
let c = 1020;
function left(){
    let b = parseInt(window.getComputedStyle(f).getPropertyValue("left"));
    if (leftCount > 0) {
        f.style.left = (b+c)+"px";
        leftCount--;
        rightCount++;
    } else {
        console.log("到底了...")
    }
}

function right(){
console.log(rightCount)
    let b = parseInt(window.getComputedStyle(f).getPropertyValue("left"));
    if(rightCount > 0){
        f.style.left = (b-c)+"px";
        rightCount--;
        leftCount++;
    }else {
        console.log("到底了...")
    }
}